/*
  In App.xaml:
  <Application.Resources>
      <vm:ViewModelLocator xmlns:vm="clr-namespace:HIWSystem"
                           x:Key="Locator" />
  </Application.Resources>
  
  In the View:
  DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"

  You can also use Blend to do all this with the tool's support.
  See http://www.galasoft.ch/mvvm
*/

using CommonServiceLocator;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;

namespace HIWSystem.ViewModel
{
    /// <summary>
    /// This class contains static references to all the view models in the
    /// application and provides an entry point for the bindings.
    /// </summary>
    public class ViewModelLocator
    {
        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            ////if (ViewModelBase.IsInDesignModeStatic)
            ////{
            ////    // Create design time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DesignDataService>();
            ////}
            ////else
            ////{
            ////    // Create run time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DataService>();
            ////}

            SimpleIoc.Default.Register<MainViewModel>();
            SimpleIoc.Default.Register<AddStationViewModel>();
            SimpleIoc.Default.Register<MenuLevelDescViewModel>();
            SimpleIoc.Default.Register<AddEmployeeViewModel>();
            SimpleIoc.Default.Register<MenuManageViewModel>();
            SimpleIoc.Default.Register<MenuNamedViewModel>();
            SimpleIoc.Default.Register<AddPartNumberViewModel>();
            SimpleIoc.Default.Register<AddRoutingViewModel>();
            SimpleIoc.Default.Register<ReleaseWOViewModel>();
            SimpleIoc.Default.Register<LabelPrintViewModel>();
            SimpleIoc.Default.Register<EmployeeMenuManageViewModel>();
            SimpleIoc.Default.Register<ENDViewModel>();
            SimpleIoc.Default.Register<PrintConfigDescViewModel>();
            SimpleIoc.Default.Register<PackingPrintParamConfigDescViewModel>();
            SimpleIoc.Default.Register<PackingPrintViewModel>();
            SimpleIoc.Default.Register<IMDInfoEntryViewModel>();
            SimpleIoc.Default.Register<QCInfoEntryViewModel>();
            SimpleIoc.Default.Register<WOQueryViewModel>();
            SimpleIoc.Default.Register<TUNNINGInfoEntryViewModel>();
            SimpleIoc.Default.Register<TUNNINGInfoQueryViewModel>();
            SimpleIoc.Default.Register<AssemblyInfoEntryViewModel>();
            SimpleIoc.Default.Register<UpdateEmployeeViewModel>();
            SimpleIoc.Default.Register<StatisticsStationOutputViewModel>();
            SimpleIoc.Default.Register<PartNumberQueryViewModel>();
            SimpleIoc.Default.Register<UpdateStationViewModel>();
            SimpleIoc.Default.Register<ShipViewModel>();
            SimpleIoc.Default.Register<PlanOutputInfoEntryViewModel>();
            SimpleIoc.Default.Register<PlanOutputInfoQueryViewModel>();
            SimpleIoc.Default.Register<ShipReportViewModel>();
            SimpleIoc.Default.Register<SnFormatDefineViewModel>();
            SimpleIoc.Default.Register<IMDReportGenerateViewModel>();
            SimpleIoc.Default.Register<IMDYieldQueryViewModel>();
            SimpleIoc.Default.Register<AddBindStationViewModel>();
            SimpleIoc.Default.Register<ATEReportSummaryViewModel>();
            SimpleIoc.Default.Register<TestSoftwareManageViewModel>();
            SimpleIoc.Default.Register<LabelConfigViewModel>();
            SimpleIoc.Default.Register<InputBoxViewModel>();
            SimpleIoc.Default.Register<TestTrackingObsoleteViewModel>();
        }

        public MainViewModel Main
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MainViewModel>();
            }
        }
        public AddStationViewModel  AddStation
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AddStationViewModel>();
            }
        }
        public MenuLevelDescViewModel MenuLevelDesc
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MenuLevelDescViewModel>();
            }
        }
        public AddEmployeeViewModel AddEmployee
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AddEmployeeViewModel>();
            }
        }
        public MenuManageViewModel MenuManage
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MenuManageViewModel>();
            }
        }
        public MenuNamedViewModel MenuNamed
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MenuNamedViewModel>();
            }
        }
        public AddPartNumberViewModel AddPartNumber
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AddPartNumberViewModel>();
            }
        }
        public AddRoutingViewModel AddRouting
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AddRoutingViewModel>();
            }
        }
        public ReleaseWOViewModel ReleaseWO
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ReleaseWOViewModel>();
            }
        }
        public LabelPrintViewModel LabelPrint
        {
            get
            {
                return ServiceLocator.Current.GetInstance<LabelPrintViewModel>();
            }
        }
        public EmployeeMenuManageViewModel EmployeeMenuManage
        {
            get
            {
                return ServiceLocator.Current.GetInstance<EmployeeMenuManageViewModel>();
            }
        }
        public ENDViewModel END
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ENDViewModel>();
            }
        }
        public PrintConfigDescViewModel PrintConfigDesc
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PrintConfigDescViewModel>();
            }
        }
        public PackingPrintParamConfigDescViewModel PackingPrintParamConfigDesc
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PackingPrintParamConfigDescViewModel>();
            }
        }
        public PackingPrintViewModel PackingPrint
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PackingPrintViewModel>();
            }
        }
        public IMDInfoEntryViewModel IMDInfoEntry
        {
            get
            {
                return ServiceLocator.Current.GetInstance<IMDInfoEntryViewModel>();
            }
        }
        public QCInfoEntryViewModel QCInfoEntry
        {
            get
            {
                return ServiceLocator.Current.GetInstance<QCInfoEntryViewModel>();
            }
        }
        public WOQueryViewModel WOQuery
        {
            get
            {
                return ServiceLocator.Current.GetInstance<WOQueryViewModel>();
            }
        }
        public TUNNINGInfoEntryViewModel  TUNNINGInfoEntry
        {
            get
            {
                return ServiceLocator.Current.GetInstance<TUNNINGInfoEntryViewModel>();
            }
        }
        public TUNNINGInfoQueryViewModel TUNNINGInfoQuery
        {
            get
            {
                return ServiceLocator.Current.GetInstance<TUNNINGInfoQueryViewModel>();
            }
        }
        public AssemblyInfoEntryViewModel AssemblyInfoEntry
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AssemblyInfoEntryViewModel>();
            }
        }
        public UpdateEmployeeViewModel UpdateEmployee
        {
            get
            {
                return ServiceLocator.Current.GetInstance<UpdateEmployeeViewModel>();
            }
        }
        public StatisticsStationOutputViewModel StatisticsStationOutput
        {
            get
            {
                return ServiceLocator.Current.GetInstance<StatisticsStationOutputViewModel>();
            }
        }
        public PartNumberQueryViewModel PartNumberQuery
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PartNumberQueryViewModel>();
            }
        }
        public UpdateStationViewModel UpdateStation
        {
            get
            {
                return ServiceLocator.Current.GetInstance<UpdateStationViewModel>();
            }
        }
        public ShipViewModel Ship
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ShipViewModel>();
            }
        }
        public PlanOutputInfoEntryViewModel PlanOutputInfoEntry
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PlanOutputInfoEntryViewModel>();
            }
        }
        public PlanOutputInfoQueryViewModel PlanOutputInfoQuery
        {
            get
            {
                return ServiceLocator.Current.GetInstance<PlanOutputInfoQueryViewModel>();
            }
        }
        public ShipReportViewModel ShipReport
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ShipReportViewModel>();
            }
        }
        public SnFormatDefineViewModel SnFormatDefine
        {
            get
            {
                return ServiceLocator.Current.GetInstance<SnFormatDefineViewModel>();
            }
        }
        public IMDReportGenerateViewModel IMDReportGenerate
        {
            get
            {
                return ServiceLocator.Current.GetInstance<IMDReportGenerateViewModel>();
            }
        }
        public IMDYieldQueryViewModel IMDYieldQuery
        {
            get
            {
                return ServiceLocator.Current.GetInstance<IMDYieldQueryViewModel>();
            }
        }
        public AddBindStationViewModel AddBindStation
        {
            get
            {
                return ServiceLocator.Current.GetInstance<AddBindStationViewModel>();
            }
        }
        public ATEReportSummaryViewModel ATEReportSummary
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ATEReportSummaryViewModel>();
            }
        }
        public TestSoftwareManageViewModel TestSoftwareManage
        {
            get
            {
                return ServiceLocator.Current.GetInstance<TestSoftwareManageViewModel>();
            }
        }
        public LabelConfigViewModel LabelConfig
        {
            get
            {
                return ServiceLocator.Current.GetInstance<LabelConfigViewModel>();
            }
        }
        public InputBoxViewModel InputBox
        {
            get
            {
                return ServiceLocator.Current.GetInstance<InputBoxViewModel>();
            }
        }
        public TestTrackingObsoleteViewModel TestTrackingObsolete
        {
            get
            {
                return ServiceLocator.Current.GetInstance<TestTrackingObsoleteViewModel>();
            }
        }
        public static void Cleanup()
        {
            // TODO Clear the ViewModels
        }
    }
}